/**
 * render column overwrite querylist4ext.js
 * 
 * @param {}
 *            value
 * @param {}
 *            cellmeta
 * @param {}
 *            record
 * @param {}
 *            rowIndex
 * @param {}
 *            columnIndex
 * @param {}
 *            store
 * @return {}
 */
function renderHeader(value, cellmeta, record, rowIndex, columnIndex, store) {
	var fieldName = Ext.getCmp(querykey).getColumnModel()
			.getDataIndex(columnIndex);
	if (fieldName == 'H_STATUS') {
		var resultString='';
		if(judge_role){
			if(value.indexOf('2')>-1){
				resultString = String
					.format(
							'<b><a href="'
									+ context
									+ '/app/lfbl.do?method=edithdl&id={0}&ck=1&querykey=' + querykey + '">查看</a></b>',
							record.data.ID, value);
			}else{
				resultString = String
					.format(
							'<b><a href="'
									+ context
									+ '/app/lfbl.do?method=edithdl&id={0}&querykey=' + querykey + '">办理</a></b>',
							record.data.ID, value);
			}
			
			
		}else{
			
			resultString = String
					.format(
							'<b><a href="'
									+ context
									+ '/app/lfbl.do?method=edithdl&id={0}&querykey=' + querykey + '">办理</a></b>',
							record.data.ID, value);
		}
			

		return resultString;
	}else if (fieldName == 'XFTIME') {
		return formatDate(value);
	}else if(fieldName == 'XJTIME'){
		//var now = new Date().pattern("yyyyMMdd"); 
		var now = new Date().pattern("MM-dd-yyyy"); 
		f = value.substring(0, 4);
		m = value.substring(5, 7);
		e = value.substring(8, 10);
		var xjtime = m+"-"+e+"-"+f ;
		
		var xftime = "";
		if(record.data.XFTIME!=null){
			var total_time = record.data.XFTIME;
			var a = total_time.substring(0, 4);
			var b = total_time.substring(4, 6);
			var c = total_time.substring(6, 8);
			xftime = b+"-"+c+"-"+a ;
			
		}
		
		
		if (Date.parse(xjtime) - Date.parse(now)<= 0) {
			
			return "<div align='center'><img src='"
					+ context
					+ "/app/lf/images/lamp3.gif'  style='margin-bottom:-4px'/></div>" ;
			}else if (Date.parse(xjtime) - Date.parse(now)  >= 15*1000*60*60*24) {
			return "<div align='center'><img src='"
					+ context
					+ "/app/lf/images/lamp4.gif'  style='margin-bottom:-4px'/></div>" ;
			}else{
					
					if(xftime!=""){
						
						if(Date.parse(xjtime) - Date.parse(now)<=(Date.parse(xjtime) - Date.parse(xftime))/2){
							return "<div align='center'><img src='"
								+ context
								+ "/app/lf/images/lamp2.gif'  style='margin-bottom:-4px'/></div>" ;
						}else{
							return "<div align='center'><img src='"
									+ context
									+ "/app/lf/images/lamp4.gif'  style='margin-bottom:-4px'/></div>" ;
						}
					}else{
						return "<div align='center'><img src='"
								+ context
								+ "/app/lf/images/lamp2.gif'  style='margin-bottom:-4px'/></div>" ;
					}
			}
		return now;
	}
	return value;
}